<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 通过构造函数继承属性
        function Father(name) {
            this.name = name;
        }

        function Son(name) {
            Father.call(this, name) // 改变父构造函数里面的this, 指向为Son, 这样Son就能继承父构造函数里面的属性
        }

        var son = new Son('jack');
        console.log(son);
    </script>
</body>

</html>